package com.swsc.ai.taskfactory;

/**
 * @author QF
 * @date 2023/10/11 9:32
 * @describe
 */
public class TaskFactory {

    public Task getTask(String className) {
        //加载数据
        Class<?> aClass = null;
        try {
            aClass = Class.forName("com.swsc.ai.tasks." + className);
            Task task = (Task) aClass.newInstance();
            return task;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
